package com.mrsphoto.mrphoto.fragment;

import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.mrsphoto.mrphoto.R;
import com.mrsphoto.mrphoto.activity.BaseFragment;
import com.mrsphoto.mrphoto.model.IHomePhotoView;
import com.mrsphoto.mrphoto.presenter.HomePhotoPressenter;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by King on 2016/6/29.
 */
public class HomePhotoFragment extends BaseFragment implements IHomePhotoView {
    public static String HOME_FRAGMENT = "home_fragment";

    HomePhotoPressenter pressenter = new HomePhotoPressenter(this);
    @Bind(R.id.tv_home_photo_datas)
    TextView tvHomePhotoDatas;
    @Bind(R.id.ll_home_photo)
    LinearLayout llHomePhoto;

    public static HomePhotoFragment newInstance(String msg) {
        HomePhotoFragment fragment = new HomePhotoFragment();
        Bundle bundle = new Bundle();
        bundle.putSerializable(HOME_FRAGMENT, msg);
        fragment.setArguments(bundle);
        return fragment;
    }

    @Override
    protected void initView(View view, Bundle savedInstanceState) {

    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_home_photo;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View rootView = super.onCreateView(inflater, container, savedInstanceState);
        ButterKnife.bind(this, rootView);
        return rootView;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }

    @OnClick(R.id.tv_home_photo_datas)
    public void onClick() {
        pressenter.toRight();
    }

    @Override
    public void setDate() {
        tvHomePhotoDatas.setText("我设置的");
    }

    @Override
    public void setTitleText() {

    }

    @Override
    public void setImageText() {

    }

    @Override
    public void setImageResources() {

    }

    @Override
    public void setLieNumber() {

    }

    @Override
    public void addImagView(int resourceid) {
        ImageView imageView= new ImageView(getActivity());
        imageView.setImageResource(resourceid);
        llHomePhoto.addView(imageView);
    }


    @Override
    public void addTextView() {

    }
}
